<!DOCTYPE html>
<html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width,initial-scale=1,maximum-scale=1,minimum-scale=1,user-scalable=no" />
    <meta content="yes" name="apple-mobile-web-app-capable" />
    <meta content="black" name="apple-mobile-web-app-status-bar-style">
    <meta content="telephone=no" name="format-detection" />
    <meta content="emai=no" name="format-detection" />
    <meta charset="utf-8" />
    <title>芝士宝宝灵丹妙药</title>
    <link rel="stylesheet" type="text/css" href="/baby/css/common.css" />
    <link rel="stylesheet" type="text/css" href="/baby/css/gift.css" />
    <script src="/baby/js/zepto-1.1.6.js"></script>
    <script type="text/javascript" src="http://res.wx.qq.com/open/js/jweixin-1.0.0.js"></script>
    <script>
	var _hmt = _hmt || [];
	(function() {
	  var hm = document.createElement("script");
	  hm.src = "//hm.baidu.com/hm.js?19f39b206aedf768b42fbc69e4e4f721";
	  var s = document.getElementsByTagName("script")[0]; 
	  s.parentNode.insertBefore(hm, s);
	})();
	</script>
</head>
<body>
    <header>
        <img src="/baby/img/h_gift.png" alt="芝士宝宝灵丹妙药" />
    </header>
    <section>
        <img class="congratulation" src="/baby/img/a_congratulation.png" />
		<p><strong>您获得了限量版芝士大礼包！</strong></p>
		<p class="reset">礼品只剩下<span class="special"><?php echo $row['num']?></span>件了，还不快来领取！</p>
		<p><img src="/baby/img/i_down.png" /></p>
		<p>长按识别二维码关注，回复<span class="special">芝士大礼包</span>！</p>
		<img class="qrcode" src="/baby/img/qrcode.jpg" />
		<p>扫码更有机会获取儿童基因密钥！</p>
    </section>
	<script type="text/javascript">
    Zepto(function ($) {
        wx.config({
            debug: false,
            appId: '<?php echo $js_config['appId']?>',
            timestamp: <?php echo $js_config['timestamp']?>,
            nonceStr: '<?php echo $js_config['noncestr']?>',
            signature: '<?php echo $js_config['signature']?>',
            jsApiList: [
            	'onMenuShareTimeline',
            	'onMenuShareAppMessage'
            ]
        });
        wx.ready(function () {
        	wx.onMenuShareTimeline({
        	    title: '<?php echo $title?>', // 分享标题
        	    link: '<?php echo $share_url?>', // 分享链接
        	    imgUrl: 'http://wx.zhishimama.com/baby/img/sharelogo.png', // 分享图标
        	    success: function () {
        		    var current = window.location.href;
        	        // 用户确认分享后执行的回调函数
        	        $.ajax({
        				url: "/baby/statistic",
        				data: {url: current, page_id: 4},
        				type: "post",
        				success: function(res){
        				}
        				
        		    });
        	    },
        	    cancel: function () {
        	        // 用户取消分享后执行的回调函数
        	    }
        	});

        	wx.onMenuShareAppMessage({
        	    title: '<?php echo $title?>', // 分享标题
        	    desc: '<?php echo $content?>', // 分享描述
        	    link: '<?php echo $share_url?>', // 分享链接
        	    imgUrl: 'http://wx.zhishimama.com/baby/img/sharelogo.png', // 分享图标
        	    type: 'link', // 分享类型,music、video或link，不填默认为link
        	    dataUrl: '', // 如果type是music或video，则要提供数据链接，默认为空
        	    success: function () {
        	        // 用户确认分享后执行的回调函数
        	    	var current = window.location.href;
        	        // 用户确认分享后执行的回调函数
        	        $.ajax({
        				url: "/baby/statistic",
        				data: {url: current, page_id: 4},
        				type: "post",
        				success: function(res){
        				}
        				
        		    });
        	    },
        	    cancel: function () {
        	        // 用户取消分享后执行的回调函数
        	    }
        	});
        });
    })
	
	</script>
</body>
</html>
